<?php
class Hotel extends CI_Controller {



    public function index() {
      

    }

    public function list_hotels()
    {
        $acc_id=$this->uri->segment(4);
        $this->load->model('hotel_model');
        $data["hoteldetailarray"]= $this->hotel_model->get_hotel_list($acc_id);
       // print_r( $data["hoteldetailarray"]);exit;
        foreach($data["hoteldetailarray"] as $arr)
        {
            $facilityarr[$arr["hotelid"]]=$this->hotel_model->get_hotel_facilities($arr["hotelid"]);
        }
        $data["hotelfacilityarray"]= $facilityarr;
        $this->template->set('title', '');
        $data["acc_arr"] = $this->hotel_model->get_accomodations();
        $this->template->load('template', 'hotel_list', $data);
    }

    public function hotel_details()
    {
        $hotel_id=$this->uri->segment(4);
        $this->load->model('hotel_model');
        $hoteldetailarray= $this->hotel_model->get_hotel_details_by_hotel_id($hotel_id);
        $data["hotelid"]=$hoteldetailarray["hotelid"];
        $data["hotelname"]=$hoteldetailarray["hotelname"];
        $data["hoteldesc"]=$hoteldetailarray["hoteldesc"];
        $data["ratingcount"]=$hoteldetailarray["ratingcount"];
        $data["hotelfacilityarray"]= $this->hotel_model->get_hotel_facilities($hotel_id);
        $data["hotelimagearray"]= $this->hotel_model->get_hotel_images($hotel_id);
        $hotelcontents=$this->hotel_model->get_hotel_content($hotel_id);
        $data["location"]  =$hotelcontents["location"];
        $data["about"]  =$hotelcontents["about"];
        $data["accomodation"]  =$hotelcontents["accomodation"];
        $data["facilities"]  =$hotelcontents["facilities"];
        $data["excursion"]  =$hotelcontents["excursion"];

        $data["acc_arr"] = $this->hotel_model->get_accomodations();
        // print_r($data);exit;
        $this->template->set('title', '');
        $this->template->load('template', 'hotel_detail', $data);
    }

    

    

}
?>
